class TestIt:
    def __init__(self,list):
        self.currentIndex = 0
        self.list = list
    def next(self):
        e =self.list[self.currentIndex]
        self.currentIndex+=1
        return e
    def hash(self):
        return (len(self.list)> self.currentIndex)



aa = [1,2,3,4]
te = TestIt(aa)
while te.hash():
    print(te.next())
